home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / 3d_tools / irit40s.lha / Irit / grapdrvs / drawptvc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-30  |  1.2 KB  |  46 lines

  1. /*****************************************************************************
  2. *   Default point/vector drawing routine common to graphics drivers.         *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.1, June 1993.  *
  5. *****************************************************************************/
  6.  
  7. #include "irit_sm.h"
  8. #include "iritprsr.h"
  9. #include "cagd_lib.h"
  10. #include "iritgrap.h"
  11.  
  12. /****************************************************************************
  13. * Draw a Point/Vector object using current modes and transformations.        *
  14. ****************************************************************************/
  15. void IGDrawPtVec(IPObjectStruct *PObj)
  16. {
  17.     static PointType
  18.     Zero = { 0.0, 0.0, 0.0 };
  19.     int i;
  20.     PointType Ends[6];
  21.     RealType
  22.     *Pt = PObj -> U.Pt;
  23.  
  24.     IGSetColorObj(PObj);
  25.  
  26.     for (i = 0; i < 6; i++)
  27.     PT_COPY(Ends[i], Pt);
  28.  
  29.     Ends[0][0] -= IG_POINT_WIDTH;
  30.     Ends[1][0] += IG_POINT_WIDTH;
  31.     Ends[2][1] -= IG_POINT_WIDTH;
  32.     Ends[3][1] += IG_POINT_WIDTH;
  33.     Ends[4][2] -= IG_POINT_WIDTH;
  34.     Ends[5][2] += IG_POINT_WIDTH;
  35.  
  36.     for (i = 0; i < 6; i += 2) {
  37.     IGMoveTo3D(Ends[i]);
  38.     IGLineTo3D(Ends[i+1]);
  39.     }
  40.  
  41.     if (IP_IS_VEC_OBJ(PObj)) {
  42.     IGMoveTo3D(Pt);
  43.     IGLineTo3D(Zero);
  44.     }
  45. }
  46.